import request from '@/utils/request'



// 获取所有单据号 有条件限制
export function getOrderIdList () {
  return request({
    url: '/wms/grain/getOrderIdList',
    method: 'get',
  })
}
// 获取所有信息
export function getInfoList () {
  return request({
    url: '/wms/grain/getInfoList',
    method: 'get',
  })
}
// 修改入库审核状态
export function updateEnterStatus (id, enterStatus) {
  return request({
    url: '/wms/grain/updateEnterStatus',
    method: 'put',
    params: {
      id, enterStatus
    }
  })
}
// 修改补货审核状态
export function updateRepairStatus (id, repairStatus) {
  return request({
    url: '/wms/grain/updateRepairStatus',
    method: 'put',
    params: {
      id, repairStatus
    }
  })
}
// 修改申请状态
export function changeCreateStatus (id) {
  return request({
    url: '/wms/grain/changeCreateStatus',
    method: 'get',
    params: {
      id
    }
  })
}

// 删除中间表
export function delStorageInfoGoods (storageId, goodsId) {
  return request({
    url: '/wms/grain/delStorageInfoGoods',
    method: 'delete',
    params: {
      "storageId": storageId,
      "goodsId": goodsId
    }
  })
}
// 入库
export function changeGrainStatus (id) {
  return request({
    url: '/wms/grain/changeGrainStatus',
    method: 'get',
    params: {
      id
    }
  })
}

// 查询信息列表
export function list(query) {
  return request({
    url: '/wms/material/list',
    method: 'get',
    params: query
  })
}
// 查询入库信息列表
export function Search(query) {
  return request({
    url: '/wms/material/seclist',
    method: 'get',
    params: query
  })
}
export function getGrain (id) {
    return request({
      url: '/wms/grain/' + id,
      method: 'get'
    })
  }

// 新增入库信息
export function updateAudit (data) {
  return request({
    url: '/wms/material/audit',
    method: 'post',
    data: data
  })
}


